<%@ page import="java.util.Date" %>

<%--
  Created by IntelliJ IDEA.
  User: GW6666
  Date: 2020-02-29
  Time: 13:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page pageEncoding="utf-8" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>

<%--  jsp表达式--%>
  <%=new Date()%>

  <hr>

<%--  jsp脚本片段--%>
  <%
    int sum=0;
    for (int i = 0; i < 100; i++) {
      sum=sum+i;
    }
    out.println("<h1>Sum="+sum+"</h1>");
  %>

  <hr>


<%--  在代码中嵌入HTML标签--%>
  <%
    for (int i = 0; i < 5; i++) {
  %>
    <h1>Hello World!</h1> <%=i%>
<%
  }
%>


  </body>
</html>
